﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevFx.FrameWork.Context
{
    /// <summary>
    /// 上下文接口
    /// </summary>
    public interface IContext
    {
        #region 公共方法

        /// <summary>
        /// 是否包含该键值对象
        /// </summary>
        /// <param name="key">键值</param>
        /// <returns></returns>
        bool Contains(string key);

        /// <summary>
        /// 获取对象
        /// </summary>
        /// <param name="key">键值</param>
        /// <returns></returns>
        object GetItem(string key);

        /// <summary>
        /// 添加键值对
        /// </summary>
        /// <param name="key">键值</param>
        /// <param name="value">对象</param>
        void PutItem(string key, object value);

        /// <summary>
        /// 删除项
        /// </summary>
        /// <param name="key">键值</param>
        void Remove(string key);

        #endregion

        #region 公共属性
        /// <summary>
        /// 获取上下文中所有的项集合
        /// </summary>
        /// <returns></returns>
        IDictionary<string, object> Items { get; }

        #endregion


    }
}
